/*    */ package com.hp.bon.sgw.service;
/*    */ 
/*    */ import com.hp.bon.sgw.Constants;
/*    */ import java.io.File;
/*    */ import java.util.Calendar;
/*    */ import org.slf4j.Logger;
/*    */ import org.slf4j.LoggerFactory;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ 
/*    */ public class GenerateCompareFileService
/*    */ {
/* 21 */   private static final Logger logger = LoggerFactory.getLogger(GenerateCompareFileService.class);
/*    */   private DataStatusService dataStatService;
/*    */   private ConfigService configService;
/*    */   private String compareFilePath;
/* 26 */   private int compareFileHour = 1;
/* 27 */   private Calendar lastTime = null;
/*    */ 
/*    */   public void excute() {
/* 30 */     Calendar cur = Calendar.getInstance();
/* 31 */     cur.setTimeInMillis(System.currentTimeMillis());
/* 32 */     if (this.lastTime != null) {
/* 33 */       if (cur.get(11) == this.compareFileHour) { if (this.lastTime
/* 34 */           .get(5) == cur
/* 35 */           .get(5)); } } else { logger.info("begin generate compare file ...");
/* 37 */       loadConfig();
/* 38 */       this.dataStatService.genarateCompareFile(this.compareFilePath);
/* 39 */       this.lastTime = cur;
/* 40 */       logger.info("generate compare file end."); }
/*    */   }
/*    */ 
/*    */   public void loadConfig()
/*    */   {
/* 45 */     this.compareFileHour = this.configService.getIntValue(
/* 46 */       Constants.Param_CompareFileHour, 1);
/* 47 */     File file = new File(this.compareFilePath);
/* 48 */     if (!file.exists())
/* 49 */       file.mkdir();
/*    */   }
/*    */ 
/*    */   @Autowired
/*    */   public void setDataStatService(DataStatusService dataStatService)
/*    */   {
/* 55 */     this.dataStatService = dataStatService;
/*    */   }
/*    */ 
/*    */   @Autowired
/*    */   public void setConfigService(ConfigService configService) {
/* 60 */     this.configService = configService;
/*    */   }
/*    */ 
/*    */   public void setCompareFilePath(String compareFilePath) {
/* 64 */     this.compareFilePath = compareFilePath;
/*    */   }
/*    */ }

/* Location:           C:\Users\think\Desktop\sgw_2.1.jar
 * Qualified Name:     com.hp.bon.sgw.service.GenerateCompareFileService
 * JD-Core Version:    0.6.1
 */